package com.piece.admin.context.init;

import com.piece.admin.support.SiteConfigSupport;
import com.piece.core.web.initializer.SystemScript;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;

/**
 * 加载系统配置
 */
@Slf4j
@Component
public class InitOptions implements SystemScript {

    @Resource
    private SiteConfigSupport siteConfigSupport;

    @Override
    public String getScriptName() {
        return "加载系统配置";
    }

    @Override
    public void doInit() throws Exception {
        siteConfigSupport.load();
    }

    @Override
    public Integer getIndex() {
        return Integer.MAX_VALUE;
    }
}
